Page({
    data: {
        info: null,
    },
    onShow() {
        this.getDetail()
    },
    /**获取供应商详情信息 */
    getDetail() {
        this.request({
            url: '/supplier/supplier/detail'
        }, res => {
            this.setData({ info: res.data })
        }, res => {
            if (res.code == 13003) {
                this.redirect_login()
            }
        })
    },
    /**前往绑定微信 */
    toBindWechat() {
        wx.navigateTo({ url: '/pages/bind_wechat/index?phone=' + this.data.info.mobile })
    },
    /**前往修改资料 */
    toEditProfile() {
        wx.navigateTo({
            url: '/pages/edit_profile/index',
            success: res => {
                res.eventChannel.emit('acceptDataFromOpenerPage', { supplierInfo: this.data.info })
            }
        })
    },
})